<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="com.manage.grouppriv.GroupPrivVo"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String gid = request.getParameter("groupvo.id");
List<GroupPrivVo> privList = (List)request.getAttribute("privlist");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
  <title></title>
<style>.table-6 select{width:200px; height:200px}
#version {border:2px solid red; margin-left:10px;}
</style>
<script type="text/javascript" src="<%=path%>/js/jquery-1.9.1.min.js"></script>
<link rel='stylesheet' href='<%=path %>/manage/grouppriv/zh-cn.default.css?v=3.3' type='text/css' media='screen' />
<script type="text/javascript"> 
function selectAll(checker, scope, type){ 
    if(scope){
        if(type == 'button'){
            $('#' + scope + ' input').each(function(){
                $(this).attr("checked", true)
            });
        }
        else if(type == 'checkbox'){
            $('#' + scope + ' input').each(function(){
                $(this).attr("checked", checker.checked)
            });
         }
    }
    else {
        if(type == 'button'){
            $('input').each(function(){
                $(this).attr("checked", true)
            });
        }
        else if(type == 'checkbox'){ 
            $('input').each(function(){
                $(this).attr("checked", checker.checked)
            });
        }
    }
}
function selectModule(){
	$("input[name='module']").each(function(){
    	$(this).attr("checked", true)
    });
}
</script> 
</head>
<body>
<style> 
#colorbox, #cboxOverlay, #cboxWrapper{z-index:9999;}
</style>
<div>
<div class='outer'>
<form id="form1" method='post' onsubmit="selectModule()" action="<%=basePath%>/group/modGroupPriv.action">
  <input type='hidden' name='groupvo.id' value='<%=gid %>'/>
  <table class='table-1 a-left'> 
    <tr class='colhead'>
      <th>模块</th>
      <th>方法</th>
    </tr>  
    <tr class='f-14px even'>
      <th class='a-right'>首页<input type='checkbox' name='module' value='index' onclick='selectAll(this, "index", "checkbox")' /></th>
      <td class='pv-10px' id='index'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_index' value='index' />
          <span class='priv'>首页</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px  bg-yellow'>
      <th class='a-right'>信息录入<input type='checkbox' name='module' value='inputmessage' onclick='selectAll(this, "inputmessage", "checkbox")' /></th>
      <td class='pv-10px' id='inputmessage'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_inputmessage' value='inputmessageright' />
          <span class='priv'>车辆信息采集</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_inputmessage' value='inputmessageright_driver' />
          <span class='priv'>驾驶证信息采集</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_inputmessage' value='inputmessageright_bussi' />
          <span class='priv'>营运车捆绑录入</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_inputmessage' value='inputmessageright_school'  />
          <span class='priv'>校车捆绑录入</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_inputmessage' value='inputmessageright_taxi'  />
          <span class='priv'>出租车捆绑录入</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px even'>
      <th class='a-right'>信息员管理<input type='checkbox' name='module' value='messager' onclick='selectAll(this, "messager", "checkbox")' /></th>
      <td class='pv-10px' id='messager'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_messager' value='messagerCenterright' />
          <span class='priv'>信息员录入</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_messager' value='messagerCenterQuery' />
          <span class='priv'>信息员查询</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_messager' value='messagerCenterMod' />
          <span class='priv'>信息员修改</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px  bg-yellow'>
      <th class='a-right'>综合查询<input type='checkbox' name='module' value='query' onclick='selectAll(this, "query", "checkbox")' /></th>
      <td class='pv-10px' id='query'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_query' value='queryCenterright' />
          <span class='priv'>车辆查询</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_query' value='queryCenterDriver' />
          <span class='priv'>驾驶人查询</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_query' value='queryCenterMsgPerson' />
          <span class='priv'>信息员查询</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_query' value='queryCenterTx' />
          <span class='priv'>通讯录查询</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px even'>
      <th class='a-right'>服务中心<input type='checkbox' name='module' value='servicecenter' onclick='selectAll(this, "servicecenter", "checkbox")' /></th>
      <td class='pv-10px' id='servicecenter'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_servicecenter' value='queryPendingList' />
          <span class='priv'>待办信息</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_servicecenter' value='queryMakingList' />
          <span class='priv'>办结信息</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_servicecenter' value='queryPassOnList' />
          <span class='priv'>转办信息</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_servicecenter' value='serviceCenterright-qqbz' />
          <span class='priv'>申请帮助</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_servicecenter' value='queryCreateList' />
          <span class='priv'>服务评价</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px  bg-yellow'>
      <th class='a-right'>文件管理<input type='checkbox' name='module' value='file' onclick='selectAll(this, "file", "checkbox")' /></th>
      <td class='pv-10px' id='file'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_file' value='uploadfileinfo' />
          <span class='priv'>上传文件</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_file' value='getNoReadFiles' />
          <span class='priv'>待阅文件</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_file' value='getReadedFiles' />
          <span class='priv'>已阅文件</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_file' value='turnfile' />
          <span class='priv'>转发文件</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_file' value='endfile' />
          <span class='priv'>落实文件</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px even'>
      <th class='a-right'>站内邮箱<input type='checkbox' name='module' value='innermail' onclick='selectAll(this, "innermail", "checkbox")' /></th>
      <td class='pv-10px' id='innermail'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_innermail' value='innermail' />
          <span class='priv'>站内邮箱</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px  bg-yellow'>
      <th class='a-right'>短信平台<input type='checkbox' name='module' value='sms' onclick='selectAll(this, "sms", "checkbox")' /></th>
      <td class='pv-10px' id='sms'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_sms' value='sms' />
          <span class='priv'>短信平台</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px even'>
      <th class='a-right'>违法告知<input type='checkbox' name='module' value='notice' onclick='selectAll(this, "notice", "checkbox")' /></th>
      <td class='pv-10px' id='notice'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_notice' value='noticeCenterright' />
          <span class='priv'>导入</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_notice' value='noticeCenterQuery' />
          <span class='priv'>查询</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px  bg-yellow'>
      <th class='a-right'>举报受理<input type='checkbox' name='module' value='report' onclick='selectAll(this, "report", "checkbox")' /></th>
      <td class='pv-10px' id='report'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_report' value='report' />
          <span class='priv'>举报受理</span>
        </div>
      </td>
    </tr>
    <tr class='f-14px even'>
      <th class='a-right'>权限分组<input type='checkbox' name='module' value='grouppriv' onclick='selectAll(this, "grouppriv", "checkbox")' /></th>
      <td class='pv-10px' id='grouppriv'>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='findAllGroup' />
          <span class='priv'>分组列表</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='addgroup' />
          <span class='priv'>新增分组</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='modifypriv' />
          <span class='priv'>权限维护</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='modifyusergroup' />
          <span class='priv'>成员维护</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='showGroupEdit' />
          <span class='priv'>编辑</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='dicManage' />
          <span class='priv'>信息管理</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='dicManageAdd' />
          <span class='priv'>信息管理-新增</span>
        </div>
        <div class='w-p20 f-left'>
          <input type='checkbox' name='actions_grouppriv' value='dicManageMod' />
          <span class='priv'>信息管理-修改</span>
        </div>
      </td>
    </tr>
    <tr>
      <td class='rowhead'>全选<input type='checkbox' onclick='selectAll(this, "", "checkbox")' /></td>
      <td class='a-center'>
         <input type='submit' id='submit' value='保存' class='button-s' />  
         <input type='button' value='返回' class='button-c' onclick='location.href="<%=basePath%>/group/findAllGroup.action"' />
      </td>
    </tr>
  </table>
</form>
</div>
</div>
</body>
</html>
<script type="text/javascript">
<%
if(privList!=null && privList.size() > 0){
	for(GroupPrivVo priv:privList){
%>
   	var method = "<%=priv.getMethod() %>";
   	$("input").each(function(){
    	if(method == $(this).attr("value")){
    		$(this).attr("checked", true);
    	}
    });
<%
	}
} 
%>
$("input[name='module']").each(function(){
    	$(this).attr("checked", false)
});
</script>
